<h3>Tutorials</h3>

<ul class="items">
    <li>
        <h4>New Post</h4>
        <form action="<?=_HTTP_ROOT?>/admin/transaction/tutorials/<?=$item['id']?>" method="POST">
            <input type="hidden" name="post_id" value="new" />
            Title:<br/>
            <input type="text" name="title" value='<?=htmlentities($item['title'], ENT_NOQUOTES, 'utf-8')?>' size="70" /><br/>
            Intro:<br/>
            <textarea class="rtf" id="intro_new" name="intro" readony cols="60" rows="1"><?=htmlentities($item['content'], ENT_QUOTES, 'utf-8')?></textarea><Br/>
            Content:<br/>
            <textarea class="rtf" id="content_new" name="content" readony cols="60" rows="1"><?=htmlentities($item['content'], ENT_QUOTES, 'utf-8')?></textarea><Br/>
            <input type="button" name="edit" value="Edit" onclick="CKEDITOR.replace('content_new');CKEDITOR.replace('intro_new');"/>
            <input type="submit" name="submit" value="Add" />
        </form>
    </li>
    <? if (!empty($items)) foreach ($items as $item) { ?>
    <li>
        <h4>#<?=$item['id']?> (<?=htmlentities($item['title'], ENT_NOQUOTES, 'utf-8')?>)</h4>
        <form action="<?=_HTTP_ROOT?>/admin/transaction/tutorials/<?=$item['id']?>" method="POST">
            <input type="hidden" name="post_id" value="<?=$item['id']?>" />
            Title:<br/>
            <input type="text" name="title" value='<?=htmlentities($item['title'], ENT_NOQUOTES, 'utf-8')?>' size="70" /><br/>
            Intro:<br/>
            <textarea class="rtf" id="intro_<?=$item['id']?>" name="intro" readony cols="60" rows="3"><?
                echo htmlentities($item['intro'], ENT_QUOTES, 'utf-8');
            ?></textarea><Br/>
            Content:<br/>
            <textarea class="rtf" id="content_<?=$item['id']?>" name="content" readony cols="60" rows="3"><?
                echo htmlentities($item['content'], ENT_QUOTES, 'utf-8');
            ?></textarea><Br/>
            <input type="button" name="edit" value="Edit" onclick="CKEDITOR.replace('content_<?=$item['id']?>');CKEDITOR.replace('intro_<?=$item['id']?>');"/>
            <?/*<input type="button" name="close_edit" value="Close Edit" onclick="CKEDITOR.replace('content_<?=$item['id']?>')"/>*/?>
            <input type="submit" name="submit" value="Save" />
            <input type="submit" name="submit" value="Delete" onclick="if (!confirm('sure?')) { return false; }"/>
        </form>
    </li>
    <? } ?>
    
    
</ul>